﻿using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace GioHangViet.Models
{
    [Table("Categories")]
    public class Category
    {
        [Key]
        [StringLength(200, ErrorMessageResourceType = typeof(Resources.Error), ErrorMessageResourceName = "ErrorCategoryAlias")]
        [Display(ResourceType = typeof(Resources.Displaies), Name = "DisplayCategoryAlias")]
        public string Alias { get; set; }

        [Required(ErrorMessageResourceType = typeof(Resources.Error), ErrorMessageResourceName = "ErrorCategoryCategoryName")]
        [StringLength(200, ErrorMessageResourceType = typeof(Resources.Error), ErrorMessageResourceName = "ErrorCategoryNameLength")]
        [Display(ResourceType = typeof(Resources.Displaies), Name = "DisplayCategoryName")]
        public string CategoryName { get; set; }

        [StringLength(200, ErrorMessageResourceType = typeof(Resources.Error), ErrorMessageResourceName = "ErrorCategoryParentLength")]
        [Display(ResourceType = typeof(Resources.Displaies), Name = "DisplayCategoryParent")]
        public string Parent { get; set; }

        [StringLength(200, ErrorMessageResourceType = typeof(Resources.Error), ErrorMessageResourceName = "ErrorCategoryDescriptionLength")]
        [Display(ResourceType = typeof(Resources.Displaies), Name = "DisplayCategoryDescription")]
        [DataType(DataType.MultilineText)]
        public string Description { get; set; }

        [Required(ErrorMessageResourceType = typeof (Resources.Error),
            ErrorMessageResourceName = "ErrorCategoryUpdateBy")]
        [StringLength(32, ErrorMessageResourceType = typeof (Resources.Error),
            ErrorMessageResourceName = "ErrorCategoryUpdateByLength")]
        [Display(ResourceType = typeof (Resources.Displaies), Name = "DisplayCategoryUpdate")]
        public string UpdateBy { get; set; }

        public List<Category> Categories;
    }
}